<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
<title></title>
</head>

<body>
<script type="text/javascript">
var str="aA12cD34eF56";									//定义字符串
var pattern=/[a-z]/gi;									//定义正则表达式
var newstr=str.replace(pattern, "*");							//执行替换操作
alert("字符串"+str+"被转换为："+newstr);						//输出转换结果
</script>
</body>
</html>
